package com.ymm.system.api.facade;

import com.ymm.system.api.dto.ShipperCargoBriefResponse;
import com.ymm.system.api.dto.ShipperCargoDetailResponse;
import com.ymm.system.api.dto.PutOnCargoRequest;
import com.ymm.system.api.utils.Result;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Author Xuecheng Li
 * @Description 系统面向货主处理货源服务
 * @Date 2022/8/4 20:59
 * @Version 1.0
 */
public interface SystemShipperCargoService {
    /**
     * 发布货源服务(更改为putonCargoRequest DTO类)
     *
     * @Param: [cargoDTO]
     * @return: void
     */
    Result<Long> cargoDeliver(PutOnCargoRequest putOnCargoRequest, Long shipperId);

    /**
     * 货主付款成功，更改货源状态
     * @param shipperId 货主Id
     * @param cargoId 货源Id
     * @return 货源Id
     */
    Result<Long> payForCargoSuccess(Long shipperId, Long cargoId);

    /**
     * 取消货源服务
     *
     * @Param: [cargoId]
     * @return: Result
     */
    Result<Long> cancelCargo(Long cargoId, Long shipperId) throws Exception;

    /**
     * 查询上架货源
     *
     * @Param: [shipperId]
     * @return: Result<List < CargoDTO>>
     */
    Result<List<ShipperCargoBriefResponse>> getOnshelfCargos(Long shipperId);

    /**
     * 查询下架货源
     *
     * @Param: 查询下架货源
     * @return: Result<List < CargoDTO>>
     */
    Result<List<ShipperCargoBriefResponse>> getOffshelfCargos(Long shipperId);

    /**
     * 获取指定货源详情
     *
     * @Param: [cargoId]
     * @return: Result<CargoDetailResponse>
     */
    Result<ShipperCargoDetailResponse> getCargoInfoByCargoId(Long cargoId);

    /**
     * 上传货源图片
     *
     * @param shipperId 货主Id
     * @param image     图片
     * @return 路径
     */
    Result<String> uploadCargoPhoto(Long shipperId, MultipartFile image);
}

